package com.park.common.poo;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * Created by Administrator on 2017-04-30.
 */
public class SystemRoleFunctionPK implements Serializable {
    private Integer roleId;
    private String functionId;

    @Column(name = "roleId")
    @Id
    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    @Column(name = "functionId")
    @Id
    public String getFunctionId() {
        return functionId;
    }

    public void setFunctionId(String functionId) {
        this.functionId = functionId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SystemRoleFunctionPK that = (SystemRoleFunctionPK) o;

        if (roleId != that.roleId) return false;
        if (functionId != null ? !functionId.equals(that.functionId) : that.functionId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = roleId;
        result = 31 * result + (functionId != null ? functionId.hashCode() : 0);
        return result;
    }
}
